#ifndef PACKAGE_H
#define PACKAGE_H

#include <QWidget>
#include "FileDirList.h"
#include "dhlz_type.h"

class package : public QWidget
{
    Q_OBJECT

public: package(void);
    ~package();
    void reset(QString pathfile);
    void set_offset(unsigned short offset);
    void set_count(unsigned short count);
    void push(int index, const file_dir_info *p_info);
    bool check(QString qstr_ver);

private:
    bool check_ram_info(void);
    bool check_ram_file(void);
    bool file_cpy(const file_info_t *pfile, const file_dir_info *p_dir);
    unsigned short str_to_hex16(const char *str);
    unsigned long str_to_hex32(const char *str);
    void hex16_to_str(unsigned short value, char *str);
    void hex32_to_str(unsigned long value, char *str);
    QString out_file;
//  file_head_t head;
    char *p_file_ram;
    unsigned long file_ram_size;
    int file_ram_len;
    int file_count;
    unsigned short add_offset;
    unsigned short head_size;
    unsigned short file_info_size;
};
#endif // PACKAGE_H
